import {Modal,Notification} from "@arco-design/web-vue";

export default {

    okNotify(msg, position = 'topRight') {
        Notification.success({
            content: msg,
            duration: 1500,
            position
        })
    },

    warningNotify(msg, position = 'topRight') {
        Notification.warning({
            content: msg,
            duration: 1500,
            position
        })
    },

    errorNotify(msg, position = 'topRight') {
        Notification.error({
            content: msg,
            duration: 1500,
            position
        })
    },

    notify(msg, position = 'topRight') {
        Notification.info({
            content: msg,
            duration: 1500,
            position
        })
    },

    confirm(content) {
        return new Promise((resolve,reject) => {
            Modal.confirm({
                title: '系统提示',
                content: content,
                okText: '确定',
                cancelText: '取消',
                type: 'warning',
                onOk(){
                    resolve(true)
                },
                onCancel(){
                    reject(false)
                }
            })
        })
    }
}
